package com.com.designpatterns.strategy.solution;

import com.com.designpatterns.strategy.solution.Expression;

/**
 * Created by pankaj on 7/13/15.
 */
public class SubstractionOperator extends Operator {
    @Override
    String getName() {
        return "Subtraction";
    }

    @Override
    int evaluate(int leftValue, int rightValue) {
        int left = leftValue;
        int right = rightValue;
        int result = left - right;

        return result;
    }

    @Override
    int evaluate(Expression leftValue, Expression rightValue) {
        int left = leftValue.Evaluate();
        int right = rightValue.Evaluate();
        int result = left - right;

        return result;
    }

}
